set db=TR_DEV
set server=localhost\SQLExpress


echo Creating base tables.

sqlcmd -S %server% -d %db% -i ".\Table\dbo.aspnet_Applications.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Table\dbo.aspnet_Users.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Table\dbo.aspnet_SchemaVersions.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Table\dbo.aspnet_Roles.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Table\dbo.aspnet_Profile.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Table\dbo.aspnet_Membership.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Table\dbo.aspnet_Paths.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Table\dbo.aspnet_PersonalizationPerUser.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Table\dbo.aspnet_PersonalizationAllUsers.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Table\dbo.aspnet_UsersInRoles.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Table\dbo.aspnet_WebEvent_Events.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Table\dbo.Log.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Table\dbo.Category.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Table\dbo.CategoryLog.Table.sql"

echo Creating base Views.

for %%f in (.\View\*.sql) do (
	echo Creating %%~nf
	sqlcmd -S %server% -d %db% -i ".\View\%%~nf.sql"
)


echo Creating base Stored Procedures.

for %%f in (*.sql) do (
	echo Creating %%~nf
	sqlcmd -S %server% -d %db% -i ".\Stored Procedure\%%~nf.sql"
)


echo Creating base-line date.

sqlcmd -S %server% -d %db% -i ".\Baseline Data\dbo.aspnet_SchemaVersions.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Baseline Data\dbo.aspnet_Applications.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Baseline Data\dbo.aspnet_Users.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Baseline Data\dbo.aspnet_Paths.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Baseline Data\dbo.aspnet_Profile.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Baseline Data\dbo.aspnet_Roles.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Baseline Data\dbo.aspnet_Membership.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Baseline Data\dbo.aspnet_PersonalizationAllUsers.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Baseline Data\dbo.aspnet_PersonalizationPerUser.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Baseline Data\dbo.aspnet_UsersInRoles.Table.sql"
sqlcmd -S %server% -d %db% -i ".\Baseline Data\dbo.aspnet_WebEvent_Events.Table.sql"
